package list;

public class Exam2_13 {
	
   public static int listFind(SeqList2_13 L,int x){
		for(int i = 0;i<SeqList2_13.size;i++){
			if(L.list[i] == x) return i;
		}
		return -1;
	}
	
	public static void main(String args[]){
		SeqList2_13 L = new SeqList2_13();
		int x = 20;
		int result = Exam2_13.listFind(L,x);
		System.out.println(x+ " position is " + result);
		converse(L);
		System.out.println(SeqList2_13.size);
		for(int y=0;y<SeqList2_13.size;y++){
			System.out.print(L.list[y]+" ");
		}
		System.out.println();
		for(int t:L.list){
			System.out.print(t+" ");
		}
		
	}
	
	public static void converse(SeqList2_13 L){
		int mid,i;
		int x;
		mid = SeqList2_13.size/2;
		for(i=0;i<mid;i++){
			x=L.list[i];
			L.list[i] = L.list[SeqList2_13.size-1-i];
			L.list[SeqList2_13.size-1-i] = x;
		}
		
	}

}

class SeqList2_13 {
	public int[] list = new int[50];
	public static int size;
	public SeqList2_13(){
		size = 0;
		for(int i = 0;i<list.length-1;i++){
			int m =  (int) (Math.random()*100);
			if(m > 100) break;
			list[i] = m;
			size++;
			System.out.print(m+" ");
		}
		System.out.println();
		System.out.println(size);
	}
}
